<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 自动回复表
 */
class CreateWxAutoreplys extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_autoreplys', function (Blueprint $table) {
            $table->increments('id')->comment('序号');
            $table->string('name', 20)->default('')->comment('自动回复名称');
            $table->mediumText('keywords')->comment('关键词列表');
            $table->timestamp('start_time')->nullable()->comment('开始时间');
            $table->timestamp('end_time')->nullable()->comment('结束时间');
            $table->string('msg_type')->comment('消息类型');
            $table->unsignedInteger('order_num')->comment('排序数字');
            $table->mediumText('content')->commen('自动回复文本内容');
            $table->string('touser', 60)->default('')->comment('接收者openid');
            $table->string('template_id', 60)->default('')->comment('模板ID');
            $table->unsignedInteger('material_id')->comment('本地素材ID');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_autoreplys');
    }
}
